#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>

#include "mystdio.h"

int main()
{
    myFILE* fp = my_fopen("./log.txt","w");
    if(fp == NULL)
    {
        perror("my_fopen");
        return 1;
    }

    const char* msg = "haha, this is my stdio lib";
    int cnt = 10;
    while(cnt--)
    {
        my_fwrite(msg,strlen(msg),fp);
        sleep(1);
    }

    my_fclose(fp);
    return 0;
}
